Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Media Functions / Selecting Media Handlers


SetMediaDataHandler

The SetMediaDataHandler function allows you to assign a data handler to a media.

pascal OSErr SetMediaDataHandler (Media theMedia, short index, 
                              DataHandlerComponent dataHandler);
theMedia
Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as NewTrackMedia and GetTrackMedia (described on page 2-138 and page 2-190, respectively).
index
Identifies the data reference for this data handler. You provide the
index value that corresponds to the data reference. You must set this parameter to 1.
dataHandler
Specifies the data handler for the media. This identifier is a component instance that specifies a connection to a data handler component (see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for more information about components). If the data handler you specify cannot work with the data stored in the media, the function does not change the media's data handler.
DESCRIPTION
When you create a new media or load an existing media into memory, the media handler assigns an appropriate data handler to the track's media.

Note
Your application should not call the SetMediaDataHandler
function. The Movie Toolbox assigns a data handler to each media when you load a movie.
ERROR CODES
badComponentType-2005Component cannot accommodate this data
invalidMedia-2008This media is corrupted or invalid

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996